import java.util.Scanner;
//按顺序打印数字的每一位（如123打印1 2 3）

public class Test {
    public static void print(int n) {

        if(n <=9 ){
            System.out.println(n);
            return;

        }else{
            print(n / 10);
        }

        System.out.println(n % 10);



    }

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int num=sc.nextInt();
        print(num);


    }

}
